home *** CD-ROM | disk | FTP | other *** search
/ Game.EXE 2001 January / Game.EXE_01_2001.iso / demos / Blade of Darkness / data1.cab / Program_Executable_Files / Lib / pocimac.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2000-11-16  |  21.8 KB  |  512 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 1.5)
  3.  
  4. import OnInitTake
  5. import ReadGSFile
  6. import Bladex
  7. import Actions
  8. import CharStats
  9. import whrandom
  10. import GenFX
  11. import Reference
  12. import AuxFuncs
  13. POTION_STATE_USED = 0
  14. POTION_STATE_UNUSED = 1
  15. POTION_TYPE_EAT = 0
  16. POTION_TYPE_DRINK_RIGHT = 1
  17. POTION_TYPE_GULP = 2
  18. POTION_TYPE_DRINK_LEFT = 3
  19. POWERUP_TYPE_LIFE = 0
  20. POWERUP_TYPE_ATTACK = 1
  21. POWERUP_DEACTIVATED = 2
  22. POWERUP_ACTIVATED = 1
  23.  
  24. def RestoreWounds(EntityName, woundfactor = 0.0):
  25.     me = Bladex.GetEntity(EntityName)
  26.     woundlist = []
  27.     for i in range(32):
  28.         pass
  29.     
  30.     while len(woundlist) and len(woundlist) / 11.0 > woundfactor:
  31.         if woundlist.count(3):
  32.             wound2clear = 3
  33.         elif whrandom.randint(0, 1):
  34.             wound2clear = whrandom.choice(woundlist)
  35.         else:
  36.             wound2clear = woundlist[0]
  37.         me.SetWoundedZone(wound2clear, 0)
  38.         woundlist.remove(wound2clear)
  39.  
  40.  
  41. def RestoreWoundsToLifeLevel(EntityName):
  42.     me = Bladex.GetEntity(EntityName)
  43.     woundfactor = 1.0 - me.Life / CharStats.GetCharMaxLife(me.Kind, me.Level)
  44.     RestoreWounds(EntityName, woundfactor)
  45.  
  46.  
  47. class Pocima:
  48.     
  49.     def __init__(self, pot):
  50.         self.Hand = 0
  51.         self.Estado = POTION_STATE_UNUSED
  52.         self.Increment = 25
  53.         self.MaxLife = 200
  54.         self.DrinkFunc = 0
  55.         self.DrinkFuncArguments = ()
  56.         self.Sonido = 0
  57.         self.Type = POTION_TYPE_DRINK_RIGHT
  58.         self.OHand = ''
  59.         self.PowerPotion = 0
  60.         self.TimeStartPowerPotion = 5.0
  61.         self.TimePowerPotion = 10.0
  62.         self.OldFDefense = 0.0
  63.         self.OldFAttack = 0.0
  64.         self.FDefense = 4.0
  65.         self.FAttack = 4.0
  66.         self.PowerUpEstado = POWERUP_DEACTIVATED
  67.         self.LifePowerUpI = 0
  68.         self.LifePowerUp = 100
  69.         self.FadeDelta = 0.2 / 60.0
  70.         self.CuresPoison = 0
  71.  
  72.     
  73.     def IncrementLife(self):
  74.         UsedBy2 = Bladex.GetEntity(self.entity)
  75.         UsedBy = self
  76.         if UsedBy.PowerUpEstado == POWERUP_ACTIVATED:
  77.             if UsedBy.LifePowerUpI < UsedBy.LifePowerUp:
  78.                 life = UsedBy2.Life + 1.0
  79.                 if life <= self.MaxLife:
  80.                     UsedBy.LifePowerUpI = UsedBy.LifePowerUpI + 1.0
  81.                     UsedBy2.Life = life
  82.                     RestoreWoundsToLifeLevel(UsedBy2.Name)
  83.                 
  84.                 timenext = 0.5
  85.                 Bladex.AddScheduledFunc(Bladex.GetTime() + timenext, self.IncrementLife, ())
  86.             else:
  87.                 UsedBy.PowerUpEstado = POTION_STATE_USED
  88.         
  89.  
  90.     
  91.     def ActivatePowerUp(self, sector, entity):
  92.         UsedBy = self
  93.         if UsedBy.PowerUpEstado == POWERUP_DEACTIVATED:
  94.             self.entity = entity
  95.             UsedBy.PowerUpEstado = POWERUP_ACTIVATED
  96.             Bladex.AddScheduledFunc(Bladex.GetTime() + 0.5, self.IncrementLife, ())
  97.         
  98.  
  99.     
  100.     def DeactivatePowerUp(self, sector, entity):
  101.         if entity == self.entity:
  102.             UsedBy = self
  103.             if UsedBy.PowerUpEstado == POWERUP_ACTIVATED:
  104.                 UsedBy.PowerUpEstado = POWERUP_DEACTIVATED
  105.             
  106.         
  107.  
  108.     
  109.     def FinishPowerAtack(self, entity):
  110.         UsedBy = Bladex.GetEntity(entity)
  111.         if UsedBy.Data.PowerPotion == 1:
  112.             UsedBy.SelfIlum = 0.0
  113.             UsedBy.Data.FDefense = self.OldFDefense
  114.             UsedBy.Data.FAttack = self.OldFAttack
  115.             UsedBy.Data.PowerPotion = 2
  116.         
  117.  
  118.     
  119.     def StartPowerAtack(self):
  120.         if self.PowerUpEstado == POWERUP_ACTIVATED:
  121.             UsedBy = Bladex.GetEntity(self.entity)
  122.             UsedBy.SelfIlum = 1.0
  123.             self.OldFDefense = 1.0
  124.             self.OldFAttack = 1.0
  125.             UsedBy.Data.FDefense = self.FDefense
  126.             UsedBy.Data.FAttack = self.FAttack
  127.             UsedBy.Data.PowerPotion = 1
  128.             Bladex.AddScheduledFunc(Bladex.GetTime() + self.TimePowerPotion, self.FinishPowerAtack, (self.entity,))
  129.         
  130.  
  131.     
  132.     def ActivatePowerUpAtack(self, sector, entity):
  133.         if self.PowerUpEstado == POWERUP_DEACTIVATED:
  134.             UsedBy = Bladex.GetEntity(entity)
  135.             if UsedBy.Data.PowerPotion == 0:
  136.                 self.PowerUpEstado = POWERUP_ACTIVATED
  137.                 self.entity = entity
  138.                 Bladex.AddScheduledFunc(Bladex.GetTime() + self.TimeStartPowerPotion, self.StartPowerAtack, ())
  139.             
  140.         
  141.  
  142.     
  143.     def DeactivatePowerUpAtack(self, sector, entity):
  144.         if entity == self.entity:
  145.             self.PowerUpEstado = POWERUP_DEACTIVATED
  146.         
  147.  
  148.     
  149.     def Reset(self, Players = 0):
  150.         pass
  151.  
  152.     
  153.     def FadeOut(self, entity, timer):
  154.         poc = Bladex.GetEntity(entity)
  155.         poc.Alpha = poc.Alpha - poc.Data.FadeDelta
  156.         if len(poc.Lights):
  157.             poc.Lights = [
  158.                 (poc.Alpha / 2, poc.Lights[0][1], poc.Lights[0][2])]
  159.         
  160.         if poc.Alpha <= 0:
  161.             poc.SubscribeToList('Pin')
  162.         
  163.  
  164.  
  165.  
  166. def RestoreHand(entidad):
  167.     char = Bladex.GetEntity(entidad)
  168.     char.AddAnmEventFunc('ChangeREvent', Actions.ToggleWEvent)
  169.     char.LaunchAnmType('Chg_r')
  170.  
  171.  
  172. def TakePotionUsed():
  173.     pass
  174.  
  175.  
  176. def PocimaNoSoltada(entidad):
  177.     Reference.debugprint('PocimaNoSoltada')
  178.     char = Bladex.GetEntity(entidad)
  179.     object = Bladex.GetEntity(char.Data.obj_used)
  180.     if object.Data.Estado == POTION_STATE_USED:
  181.         SoltarPocima(entidad, 0)
  182.     else:
  183.         object.ExcludeHitFor(char)
  184.         inv = char.GetInventory()
  185.         if object.Data.Type == POTION_TYPE_DRINK_LEFT:
  186.             inv.LinkLeftHand2('None')
  187.             impulse = char.Rel2AbsVector(1000.0 * object.Mass, -1000.0 * object.Mass, 0.0)
  188.             object.Impulse(impulse[0], impulse[1], impulse[2])
  189.         else:
  190.             inv.LinkRightHand('None')
  191.             if object.Data.Hand == 1:
  192.                 char.AnmEndedFunc = RestoreHand
  193.             
  194.             inv.RemoveObject(char.Data.obj_used)
  195.             impulse = char.Rel2AbsVector(-1000.0 * object.Mass, -1000.0 * object.Mass, 0.0)
  196.             object.Impulse(impulse[0], impulse[1], impulse[2])
  197.  
  198.  
  199. def SoltarFood(Entidad):
  200.     char = Bladex.GetEntity(Entidad)
  201.     char.AnmEndedFunc = ''
  202.     inv = char.GetInventory()
  203.     inv.LinkRightHand('None')
  204.     inv.RemoveObject(char.Data.obj_used)
  205.     Actions.TakeStraightRecover(Entidad)
  206.  
  207.  
  208. def SoltarPocima(Entidad, Evento = 0):
  209.     char = Bladex.GetEntity(Entidad)
  210.     char.AnmEndedFunc = ''
  211.     if Evento:
  212.         char.DelAnmEventFunc(Evento)
  213.     
  214.     object = Bladex.GetEntity(char.Data.obj_used)
  215.     object.ExcludeHitFor(char)
  216.     object.TimerFunc = object.Data.FadeOut
  217.     object.SubscribeToList('Timer60')
  218.     inv = char.GetInventory()
  219.     if object.Data.Type == POTION_TYPE_DRINK_LEFT:
  220.         inv.LinkLeftHand2('None')
  221.         inv.RemoveObject(char.Data.obj_used)
  222.         impulse = char.Rel2AbsVector(1000.0 * object.Mass, -1000.0 * object.Mass, 0.0)
  223.         object.Impulse(impulse[0], impulse[1], impulse[2])
  224.     else:
  225.         inv.LinkRightHand('None')
  226.         if object.Data.Hand == 1:
  227.             char.AnmEndedFunc = RestoreHand
  228.         else:
  229.             char.AnmEndedFunc = Actions.TakeStraightRecover
  230.         inv.RemoveObject(char.Data.obj_used)
  231.         impulse = char.Rel2AbsVector(-1000.0 * object.Mass, -1000.0 * object.Mass, 0.0)
  232.         object.Impulse(impulse[0], impulse[1], impulse[2])
  233.     OnInitTake.AddOnInitTakeEvent(object.Name, TakePotionUsed)
  234.  
  235.  
  236. def RestorePowerPotion(Entidad, Potion):
  237.     char = Bladex.GetEntity(Entidad)
  238.     char.Data.FDefense = Potion.OldFDefense
  239.     char.Data.FAttack = Potion.OldFAttack
  240.     char.Data.PowerPotion = 0
  241.  
  242.  
  243. def BeberPocima(Entidad, Evento):
  244.     char = Bladex.GetEntity(Entidad)
  245.     char.DelAnmEventFunc(Evento)
  246.     Poti = Bladex.GetEntity(char.Data.obj_used)
  247.     Pot = Poti.Data
  248.     Pot.Estado = POTION_STATE_USED
  249.     if Pot.PowerPotion:
  250.         Pot.OldFDefense = char.Data.FDefense
  251.         Pot.OldFAttack = char.Data.FAttack
  252.         char.Data.FDefense = Pot.FDefense
  253.         char.Data.FAttack = Pot.FAttack
  254.         char.Data.PowerPotion = 1
  255.         Bladex.AddScheduledFunc(Bladex.GetTime() + Pot.TimePowerPotion, RestorePowerPotion, (Entidad, Pot))
  256.         GenFX.AddPersonItemFX(Entidad, Poti.Name, Pot.TimePowerPotion)
  257.     elif Pot.Increment == -1:
  258.         char.Life = CharStats.GetCharMaxLife(char.Kind, char.Level)
  259.         RestoreWounds(Entidad)
  260.     else:
  261.         Life = char.Life + Pot.Increment
  262.         LimitLife = CharStats.GetCharMaxLife(char.Kind, char.Level)
  263.         if Life > LimitLife:
  264.             char.Life = LimitLife
  265.         else:
  266.             char.Life = Life
  267.         RestoreWoundsToLifeLevel(Entidad)
  268.     if Pot.CuresPoison:
  269.         char.Data.UnVenom()
  270.     
  271.     Pot.Sonido.Play(char.Position[0], char.Position[1], char.Position[2], 0)
  272.     if Pot.DrinkFunc != 0:
  273.         Bladex.AddScheduledFunc(Bladex.GetTime(), Pot.DrinkFunc, Pot.DrinkFuncArguments)
  274.     
  275.  
  276.  
  277. def CreateMiguillas(Entidad, Evento):
  278.     char = Bladex.GetEntity(Entidad)
  279.     Poti = Bladex.GetEntity(char.Data.obj_used)
  280.     miguillas = Bladex.CreateEntity('Miguillas', 'Entity Particle System D1', 0, 0, 0)
  281.     miguillas.ParticleType = 'Miguillas'
  282.     miguillas.YGravity = 10000.0
  283.     miguillas.Friction = 0.2
  284.     miguillas.RandomVelocity = 10.0
  285.     miguillas.PPS = 200
  286.     miguillas.Time2Live = 32
  287.     miguillas.DeathTime = Bladex.GetTime() + 0.1
  288.     Poti.Link(miguillas)
  289.     if Evento == 'Bocado1Event':
  290.         Poti.TimerFunc = Poti.Data.FadeOut
  291.         Poti.SubscribeToList('Timer60')
  292.     
  293.  
  294.  
  295. def UsePotion3(Entity):
  296.     char = Bladex.GetEntity(Entity)
  297.     UsePotion2(char.Data.obj_used)
  298.  
  299.  
  300. def UsePotion2(NombrePocima):
  301.     Reference.debugprint('UsePotion2')
  302.     Pocima = Bladex.GetEntity(NombrePocima)
  303.     Char = Bladex.GetEntity(Pocima.Data.UsedBy)
  304.     Reference.debugprint(Char.AnmEndedFunc)
  305.     Char.AnmEndedFunc = Actions.TakeStraightRecover
  306.     if Pocima.Data.Type == POTION_TYPE_EAT:
  307.         Char.LaunchAnmType('eat00')
  308.         Char.AddAnmEventFunc('Bocado1Event', CreateMiguillas)
  309.         Char.AddAnmEventFunc('Bocado2Event', CreateMiguillas)
  310.         Char.AnmEndedFunc = SoltarFood
  311.     elif Pocima.Data.Type == POTION_TYPE_DRINK_RIGHT:
  312.         Char.LaunchAnmType('drink')
  313.         Char.AddAnmEventFunc('PickBottle', PickPotion)
  314.     elif Pocima.Data.Type == POTION_TYPE_GULP:
  315.         Char.LaunchAnmType('gulp00')
  316.     else:
  317.         print 'Unknown Potion Type' + `Pocima.Data.Type`
  318.     Char.AddAnmEventFunc('drinkingEvent', BeberPocima)
  319.     print 'should throw bottle with event ThrowBottle in animation ' + Char.AnimName
  320.     Char.AddAnmEventFunc('ThrowBottle', SoltarPocima)
  321.  
  322.  
  323. def TryToUsePotion(me, object):
  324.     if not Reference.HealthIncrease.has_key(object.Kind):
  325.         return 1
  326.     
  327.     if Reference.DefaultObjectData[object.Kind][0] == Reference.OBJ_ITEM:
  328.         return 1
  329.     
  330.     return CanIUseThePotion(me, object)
  331.  
  332.  
  333. def CanIUseThePotion(me, object):
  334.     if CharStats.GetCharMaxLife(me.Kind, me.Level) <= me.Life:
  335.         if me.Name == 'Player1':
  336.             import GameText
  337.             import MenuText
  338.             GameText.WriteTextAux(MenuText.GetMenuText("I don't need it, yet"), 2.0, 255, 255, 255, [])
  339.         
  340.         return 0
  341.     else:
  342.         return 1
  343.  
  344. Actions.TryToTakeCallBacks.append(TryToUsePotion)
  345.  
  346. def UsePotion(NombrePocima, TipoUso):
  347.     Pocima = Bladex.GetEntity(NombrePocima)
  348.     Char = Bladex.GetEntity(Pocima.Data.UsedBy)
  349.     if Reference.HealthIncrease.has_key(Pocima.Kind):
  350.         if not CanIUseThePotion(Char, Pocima):
  351.             return None
  352.         
  353.     
  354.     Pocima.Data.Hand = 0
  355.     Char.Data.obj_used = NombrePocima
  356.     Char.AnmEndedFunc = PocimaNoSoltada
  357.     if TipoUso == Actions.USE_FROM_INV and Pocima.Data.Estado == POTION_STATE_UNUSED:
  358.         Pocima.Data.Type = 1
  359.         if not (Char.InvRight):
  360.             UsePotion2(NombrePocima)
  361.         elif Char.InCombat:
  362.             if not (Char.InvLeft2):
  363.                 Pocima.Data.Type = 3
  364.                 Char.LaunchAnmType('attack_drink')
  365.                 Char.AddAnmEventFunc('PickBottle', PickPotion)
  366.                 Char.AddAnmEventFunc('drinkingEvent', BeberPocima)
  367.                 Char.AddAnmEventFunc('ThrowBottle', SoltarPocima)
  368.             
  369.         elif Actions.IsRightHandStandardObject(Char.Name):
  370.             if Actions.TryDropRight(Char.Name):
  371.                 Actions.DropReleaseEventHandler(Char.Name, 'DropRightEvent')
  372.             
  373.             if not (Char.InvRight):
  374.                 UsePotion2(NombrePocima)
  375.             
  376.         else:
  377.             Char.AddAnmEventFunc('ChangeREvent', Actions.ToggleWEvent)
  378.             Char.LaunchAnmType('Chg_r')
  379.             Pocima.Data.Hand = 1
  380.             Pocima.Data.OHand = Char.InvRight
  381.             Char.AnmEndedFunc = UsePotion3
  382.     elif TipoUso == Actions.USE_FROM_TAKE and Pocima.Data.Estado == POTION_STATE_UNUSED:
  383.         if Pocima.Data.Type != POTION_TYPE_EAT:
  384.             Pocima.Data.Type = POTION_TYPE_GULP
  385.             Char.AnmEndedFunc = UsePotion3
  386.         else:
  387.             Char.AnmEndedFunc = UsePotion3
  388.     
  389.  
  390.  
  391. def PickPotion(Entidad, Evento):
  392.     char = Bladex.GetEntity(Entidad)
  393.     char.DelAnmEventFunc(Evento)
  394.     Pocima = char.Data.obj_used
  395.     object = Bladex.GetEntity(char.Data.obj_used)
  396.     inv = char.GetInventory()
  397.     if object.Data.Type == 3:
  398.         inv.LinkLeftHand2(Pocima)
  399.     else:
  400.         inv.LinkRightHand(Pocima)
  401.  
  402.  
  403. def CreatePotion(Nombre, Increment = 25, MaxLife = 180):
  404.     Pot = Bladex.GetEntity(Nombre)
  405.     Pot.Static = 0
  406.     Pot.Data = Pocima(Pot)
  407.     Pot.UseFunc = UsePotion
  408.     Pot.Data.Increment = Increment
  409.     Pot.Data.MaxLife = MaxLife
  410.     if Reference.HealthIncrease.has_key(Pot.Kind):
  411.         Pot.Data.Increment = Reference.HealthIncrease[Pot.Kind][0]
  412.         Pot.Data.CuresPoison = Reference.HealthIncrease[Pot.Kind][1]
  413.     
  414.     Pot.Data.Sonido = Bladex.CreateSound('..\\..\\Sounds\\Drink.wav', 'Drinking')
  415.     Pot.Data.Sonido.Volume = 1
  416.     Pot.Data.Sonido.MinDistance = 10000
  417.     Pot.Data.Sonido.MaxDistance = 20000
  418.     return Pot.Data
  419.  
  420.  
  421. def CreateFood(Nombre, Increment = 25, MaxLife = 180):
  422.     Pot = Bladex.GetEntity(Nombre)
  423.     Pot.Static = 0
  424.     Pot.Data = Pocima(Pot)
  425.     Pot.UseFunc = UsePotion
  426.     Pot.Data.Increment = Increment
  427.     Pot.Data.MaxLife = MaxLife
  428.     Pot.Data.Type = POTION_TYPE_EAT
  429.     Pot.Data.Sonido = Bladex.CreateSound('..\\..\\Sounds\\bugbite-bone2.wav', 'Eating')
  430.     Pot.Data.Sonido.Volume = 1
  431.     Pot.Data.Sonido.MinDistance = 10000
  432.     Pot.Data.Sonido.MaxDistance = 20000
  433.     Pot.Data.FadeDelta = 0.8 / 60.0
  434.     if Reference.HealthIncrease.has_key(Pot.Kind):
  435.         Pot.Data.Increment = Reference.HealthIncrease[Pot.Kind][0]
  436.         Pot.Data.CuresPoison = Reference.HealthIncrease[Pot.Kind][1]
  437.     
  438.     return Pot.Data
  439.  
  440.  
  441. def CreatePowerPotion(Nombre, FD = 4.0, FA = 4.0, Time = 10):
  442.     PowerPot = CreatePotion(Nombre)
  443.     PowerPot.TimePowerPotion = Time
  444.     PowerPot.PowerPotion = 1
  445.     PowerPot.FDefense = FD
  446.     PowerPot.FAttack = FA
  447.     PowerPot.Increment = 0
  448.     PowerPot.CuresPoison = 0
  449.     pp = Bladex.GetEntity(Nombre)
  450.     pp.FiresIntensity = [
  451.         45]
  452.     pp.Lights = [
  453.         (0.5, 0.05, (0, 128, 255))]
  454.     pp.SelfIlum = 1
  455.     spot = AuxFuncs.GetSpot(pp)
  456.     if spot:
  457.         spot.Visible = 0
  458.         spot.CastShadows = 0
  459.     
  460.  
  461.  
  462. def CreatePowerUp(Sector, Name, Life = 100, MaxLife = 100):
  463.     res = ReadGSFile.ReadGhostSectorFile(Sector)
  464.     for igs in res:
  465.         Bladex.AddTriggerSector(igs['Name'], igs['Grupo'], igs['FloorHeight'], igs['RoofHeight'], igs['Vertex'])
  466.     
  467.     PowerUp = Pocima(0)
  468.     Bladex.SetTriggerSectorFunc(Name, 'OnLeave', PowerUp.DeactivatePowerUp)
  469.     Bladex.SetTriggerSectorFunc(Name, 'OnEnter', PowerUp.ActivatePowerUp)
  470.     PowerUp.Type = POWERUP_TYPE_LIFE
  471.     PowerUp.LifePowerUp = Life
  472.     PowerUp.MaxLife = MaxLife
  473.     return PowerUp
  474.  
  475.  
  476. def CreatePowerUpAtack(Sector, Name, FD = 4.0, FA = 4.0, TimeD = 10, TimeL = 5):
  477.     res = ReadGSFile.ReadGhostSectorFile(Sector)
  478.     for igs in res:
  479.         Bladex.AddTriggerSector(igs['Name'], igs['Grupo'], igs['FloorHeight'], igs['RoofHeight'], igs['Vertex'])
  480.     
  481.     PowerUp = Pocima(0)
  482.     Bladex.SetTriggerSectorFunc(Name, 'OnLeave', PowerUp.DeactivatePowerUpAtack)
  483.     Bladex.SetTriggerSectorFunc(Name, 'OnEnter', PowerUp.ActivatePowerUpAtack)
  484.     PowerUp.Type = POWERUP_TYPE_ATTACK
  485.     PowerUp.TimeStartPowerPotion = TimeL
  486.     PowerUp.TimePowerPotion = TimeD
  487.     PowerUp.FDefense = FD
  488.     PowerUp.FAttack = FA
  489.     return PowerUp
  490.  
  491.  
  492. def CreateDefaultPocimac(ObjectName):
  493.     obj = Bladex.GetEntity(ObjectName)
  494.     if obj.Kind == 'PowerPotion':
  495.         CreatePowerPotion(ObjectName)
  496.         return 1
  497.     
  498.     if not Reference.HealthIncrease.has_key(obj.Kind):
  499.         return 0
  500.     
  501.     if Reference.HealthIncrease[obj.Kind][2] == Reference.POCIMAC_FOOD:
  502.         CreateFood(ObjectName)
  503.         return 1
  504.     
  505.     if Reference.HealthIncrease[obj.Kind][2] == Reference.POCIMAC_POTION:
  506.         CreatePotion(ObjectName)
  507.         return 1
  508.     
  509.     print 'FATAL ERROR: The PociMac type is not defined, yet.'
  510.     return 0
  511.  
  512.